import * as React from 'react';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { getHeaderTitle } from '@react-navigation/elements';
// import {App1} from "./App1";
// import {Dl} from "./dl/Dl";
import {Home,Nav,Zc} from './index'
import { View } from 'react-native';
import { Colors } from 'react-native/Libraries/NewAppScreen';
// import Tab from "./Tab";
// import {Nav} from "../components/Nav";
const Stack = createNativeStackNavigator();
// 自定义堆栈导航
function MyStack() {
  return (
    <Stack.Navigator
       headerMode='screen'>
      <Stack.Group
        screenOptions={{ headerShown: false, }}//隐藏导航栏
      >
        {/* <Stack.Screen name="底部导航栏" component={Tab} /> */}
        <Stack.Screen name=' ' component={Home} />
      </Stack.Group>
      <Stack.Group
        screenOptions={{
          header: ({ navigation, route, options, back }) => {//设置自定义导航栏
            const title = getHeaderTitle(options, route.name);
            return (
              <Nav //引入自定义导航栏组件
                title={title}
                navigation={navigation}
                route={route}
                options={options}
                back={back}
                style={options.headerStyle} 
                />
            );
          }
        }} >
        {/* <Stack.Screen name=' ' component={Home} /> */}
        <Stack.Screen name="Zc" component={Zc} options={{ title: '请注册账号密码' }}/>
      </Stack.Group>
    </Stack.Navigator>
  );
}

export default MyStack;